
/**********************************************************/
/*     winmain.cpp      CHAOXED's Main Function (Win32)   */
/*                      By: Josh Fiorio                   */
/**********************************************************/

#include "winmain.h"

int WINAPI WinMain(HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPSTR args, int show)
{
	HWND main;
	MSG msg;
	HACCEL haccel;

	main = CreateDialog(hThisInstance, MAKEINTRESOURCE(MAIN_DLG), NULL, MAIN_DLG_Func);
	haccel = LoadAccelerators(hThisInstance, MAKEINTRESOURCE(MAIN_ACCL));
	ShowWindow(main, show);

	if (!main)
	{
		MessageBox(NULL, "MAIN_DLG Failed to Create", "OHNOES", MB_ICONERROR);
		return 0;
	}	//end if

	while (GetMessage(&msg, NULL, 0, 0) != 0)
	{
		if (!TranslateAccelerator(main, haccel, &msg))
		{
			TranslateMessage(&msg);
			DispatchMessage(&msg);	
		}	//end if
	}	//end while

	return msg.wParam;
}	//end of func.
